package cn.zyq.stater.config2;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;

@Configuration
//ConditionalOnProperty 描述:  test4.username=root
//  属性有test4.password=root 的属性数据 条件则满足,没有,或者值不是123456都不满足
//- 使用入口配置类扫描这个测试
//matchIfMissing表示如果条件不满足要不要执行(如果matchIfMissing = true表示test4.password=root 不存在也表示Condition满足)
//@ConditionalOnProperty(prefix = "test4", value = "password" ,havingValue = "root" ,matchIfMissing = true)
@ConditionalOnMissingClass({"redis.clients.jedis.dfgdsf"})//采用上边的@ConditionalOnProperty注解或者采用@ConditionalOnMissingClass()注解
public class Config6_OnCondition {
    public Config6_OnCondition(){
        System.out.println("条件配置类Config6_OnCondition ,条件满足, 加载此类");
    }
}